package cn.edu.lanqiao.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import cn.edu.lanqiao.dao.IUserEntityMapperDao;
import cn.edu.lanqiao.entity.UserEntity;
import cn.edu.lanqiao.service.IUserInfoService;
@Service("userInfoService")
public class UserInfoServiceImpl implements IUserInfoService {
	
	//组合
	@Resource
	private IUserEntityMapperDao userDao;

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public List<UserEntity> selectAll() {
		List<UserEntity> lstUser=userDao.selectAll();
		return lstUser;
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public UserEntity selectByCode(String userCode) {
		// 调用查找用户名的方法
		UserEntity userE=userDao.selectByCode(userCode);
		return userE;
	}

	@Override
	@Transactional(propagation = Propagation.REQUIRED)
	public UserEntity selectById(Integer userid) {
		// 调用查找用户id的方法
		UserEntity userE=userDao.selectById(userid);
		return userE;
	}

	

}
